#include "oraygpio.h"

void setSignLed(int rssi)
{
	if (rssi == 3) {
		orayio_setval("dongle_0", 1);
		orayio_setval("dongle_1", 1);
		orayio_setval("dongle_2", 1);
	} else if (rssi == 2) {
		orayio_setval("dongle_0", 0);
		orayio_setval("dongle_1", 1);
		orayio_setval("dongle_2", 1);
	} else if (rssi == 1) {
		orayio_setval("dongle_0", 0);
		orayio_setval("dongle_1", 0);
		orayio_setval("dongle_2", 1);
	} else {
		orayio_setval("dongle_0", 0);
		orayio_setval("dongle_1", 0);
		orayio_setval("dongle_2", 0);
	}
}

void setWifi(int on)
{
	if (!on)
		orayio_setval("wifi", 0);
	else
		orayio_setval("wifi", 1);
}

void setMCUpower(int on)
{
	if (!on)
		orayio_setval("mcu_enable", 0);
	else
		orayio_setval("mcu_enable", 1);
}
